﻿using System.Collections.Generic;

namespace Framework.FluentDictionary
{
    public interface IDictionaryFluent : IFluent<IDictionary<string, string>>
    {
        /// <summary>
        /// Adds the specified key/value.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <param name="value">The value.</param>
        /// <returns>Fluent Reference</returns>
        IDictionaryFluent Add(string key, string value);

        /// <summary>
        /// Adds the specified key/value.
        /// </summary>
        /// <param name="keyPrefix">The key prefix.</param>
        /// <param name="key">The key.</param>
        /// <param name="value">The value.</param>
        /// <returns>
        /// Fluent Reference
        /// </returns>
        IDictionaryFluent Add(string keyPrefix, string key, string value);

        /// <summary>
        /// Sets the specified key/value. This will check if the key exists and either add or set
        /// </summary>
        /// <param name="key">The key.</param>
        /// <param name="value">The value.</param>
        /// <returns>Fluent Reference</returns>
        IDictionaryFluent Set(string key, string value);

        /// <summary>
        /// Sets the specified key/value. This will check if the key exists and either add or set
        /// </summary>
        /// <param name="keyPrefix">The key prefix.</param>
        /// <param name="key">The key.</param>
        /// <param name="value">The value.</param>
        /// <returns>
        /// Fluent Reference
        /// </returns>
        IDictionaryFluent Set(string keyPrefix, string key, string value);

        /// <summary>
        /// Adds model properties as name/vales to the dictionary with a prefix value.
        /// </summary>
        /// <param name="namePrefix">The name prefix.</param>
        /// <param name="model">The model.</param>
        /// <returns></returns>
        IDictionaryFluent AddModel<TModel>(string namePrefix, TModel model) where TModel : class;

        /// <summary>
        /// Adds dictionary name/vales with a prefix value.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <returns></returns>
        IDictionaryFluent AddDictionary(IEnumerable<KeyValuePair<string, string>> data);

        /// <summary>
        /// Adds dictionary name/vales with a prefix value.
        /// </summary>
        /// <param name="namePrefix">The name prefix.</param>
        /// <param name="data">The data.</param>
        /// <returns></returns>
        IDictionaryFluent AddDictionary(string namePrefix, IEnumerable<KeyValuePair<string, string>> data);

        /// <summary>
        /// Adds dictionary name/vales with a prefix value.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <returns></returns>
        IDictionaryFluent AddDictionary(IEnumerable<NameTextValueDo> data);

        /// <summary>
        /// Adds dictionary name/vales with a prefix value.
        /// </summary>
        /// <param name="namePrefix">The name prefix.</param>
        /// <param name="data">The data.</param>
        /// <returns></returns>
        IDictionaryFluent AddDictionary(string namePrefix, IEnumerable<NameTextValueDo> data);

        /// <summary>
        /// Return the Dictionary Instance.
        /// </summary>
        /// <returns></returns>
        IDictionary<string, string> AsDictionary();
    }
}